﻿using Guoc.BigMall.Web.Services;
using Guoc.BigMall.WebService;
using Guoc.BigMall.WebService.Dto;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace Guoc.BigMall.Web.Controllers
{
    public class ProductController : Controller
    {

        IProductServce _productService;
        public ProductController(IProductServce productService)
        {
            this._productService = productService;
        }

        [HttpGet]
        public ActionResult GetList(PageVo page)
        {
            var data = _productService.GetProductList(page);         
            return new JsonNetResult(ResultModel.Ok(data));
        }
        [HttpGet]
        public ActionResult Detail(string productCode)
        {
            var row = _productService.GetByCode(productCode);
            return new JsonNetResult(ResultModel.Ok(row));
        }
    }
}